package org.rendao.flexxb.converter
{
	import com.googlecode.flexxb.converter.IConverter;
	
	import org.rendao.utils.DateUtils;
	
	public class CommonDateConverter implements IConverter
	{
		public function CommonDateConverter()
		{
		}
		
		public function get type():Class
		{
			return Date;
		}
		
		public function toString(object:Object):String
		{
			var datetime:Date = object as Date;
			return DateUtils.dateToString(datetime);
		}
		
		public function fromString(dateStr:String):Object
		{
			return DateUtils.parseDate(dateStr);
		}
	}
}